package a.client.lib_base.ui.viewmodel

import a.client.lib_base.ui.repository.BaseRepository
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.flow.FlowCollector
import kotlinx.coroutines.flow.flow

/**
@author:jacky
@Date:2021/1/18
 viewModel基类
 **/
abstract class BaseViewModel<R : BaseRepository> : ViewModel() {


 // Loading 状态
 val isLoading = MutableLiveData(false)

 protected val mRepository: R by lazy { initRepository() }

 protected abstract fun initRepository(): R
}